home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1992-11-18 | 41.4 KB | 1,155 lines | [ TEXT/MPS ]
C.S.M.P. Digest Thu, 26 Mar 92 Volume 1 : Issue 32 Today's Topics: Advanced MPW question MacApp: IsObject isn't safe! Saveing Linked Lists to a File Extended PRAM Problem with ResEdit Where can I find Teach-YourSelf-like manuals for THINK C? Beginner needs HELP! Could you please help me with this....? The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly. These digests are available (by using FTP, account anonymous, your email address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon. edu. This is also the home of the comp.sys.mac.programmer Frequently Asked Questions list. These digests are also available via email. Just send a note saying that you want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will automatically receive each new digest as it is created. The articles in these digests are taken directly from comp.sys.mac.programmer. They are not edited; all articles included in this digest are in their original posted form. The only articles that are -not- included in these digests are those which didn't receive any replies (except those that give information rather than ask a question). All replies to each article are concatenated onto the original article in the order in which they were received. Article threads are not added to the digests until the last article added to the thread is at least one month old (this is to ensure that the thread is dead before adding it to the digests). Send administrative mail to mkelly@cs.uoregon.edu. ------------------------------------------------------- From: chrism@col.hp.com (Chris Magnuson) Subject: Advanced MPW question Date: 29 Jan 92 05:52:00 GMT Organization: HP Colorado Springs Division I develop alot in the UNIX environment. In UNIX there is this binary called ctags that takes a bunch of source files and puts all the function names in one file so that when you want to edit a function you type: vi -t FunctionName And the vi editor opens up the correct file that contained the function and you're right there, ready to edit! How nice. This is a very nice feature for multi-source programming projects. What is the MPW equivalent to ctags? chrism@col.hp.com - ------------------------- From: nebel@wam.umd.edu (Chris D. Nebel) Subject: Advanced MPW question Date: 30 Jan 92 18:55:52 GMT Organization: Workstations at Maryland, University of Maryland, College Park In article <65790006@col.hp.com> chrism@col.hp.com (Chris Magnuson) writes: > What is the MPW equivalent to ctags? Lawrence D'Oliviero is correct, there is none that comes with MPW. However, there is a nice set of tools that's been on the Developer CD's for a while that does a very similar thing. There are three tools: PTags and CTags generate a "tags" file for C and Pascal source respectively, and FindTag will look up an identifier, open the correct file, and move you to the definition. They're quite zippy; I use them on a ~7MB project, (somewhere around 24000 entries in the tags file) and it takes maybe a second or two for FindTag to execute. (It tells you how to set it up so that you can simply select the identifier you want, hit a command key, and off it goes! Very nice.) Chris Nebel nebel@wam.umd.edu - ------------------------- From: tjc@ed.ac.uk (Anthony J. Cunningham) Subject: Advanced MPW question Date: 30 Jan 92 15:05:47 GMT Organization: Edinburgh University Computing Service (Semi-detatched) In article <65790006@col.hp.com>, chrism@col.hp.com (Chris Magnuson) writes: > What is the MPW equivalent to ctags? ctags (and the Browser) T -- "That'll be the day." - ------------------------- From: keith@Apple.COM (Keith Rollin) Subject: Advanced MPW question Date: 30 Jan 92 23:32:08 GMT Organization: Apple Computer Inc., Cupertino, CA In article <1992Jan30.151216.6369@waikato.ac.nz> ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes: >In article <65790006@col.hp.com>, chrism@col.hp.com (Chris Magnuson) asks: > >> What is the MPW equivalent to ctags? > >There isn't one. The best you can do is try and get by using the CMarker >tool and the marker browser facility in MPW 3.2 and later. There _is_ one; it just doesn't come with MPW. Rick Holzgrafe wrote PTags and CTags for MPW many years ago. Since he frequents this group, I'll let him fill you all in on features and availability. However, I'm pretty sure it's on the Developer CD from APDA. It might also be on ftp.apple.com. -- - ---------------------------------------------------------------------------- Keith Rollin --- <Taligent .signature under construction> Disclaimer: Pretty soon, I really _won't_ be speaking for Apple... - ------------------------- From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) Subject: Advanced MPW question Date: 30 Jan 92 02:12:16 GMT Organization: University of Waikato, Hamilton, New Zealand In article <65790006@col.hp.com>, chrism@col.hp.com (Chris Magnuson) asks: > What is the MPW equivalent to ctags? There isn't one. The best you can do is try and get by using the CMarker tool and the marker browser facility in MPW 3.2 and later. Lawrence D'Oliveiro fone: +64-7-856-2889 Computer Services Dept fax: +64-7-838-4066 University of Waikato electric mail: ldo@waikato.ac.nz Hamilton, New Zealand 37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00 To someone with a hammer and a screwdriver, every problem looks like a nail with threads. - ------------------------- From: ksand@apple.com (Kent Sandvik) Subject: Advanced MPW question Date: 31 Jan 92 04:50:02 GMT Organization: MacDTS Mongols In article <1992Jan30.151216.6369@waikato.ac.nz>, ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes: > In article <65790006@col.hp.com>, chrism@col.hp.com (Chris Magnuson) asks: > > What is the MPW equivalent to ctags? > There isn't one. The best you can do is try and get by using the CMarker > tool and the marker browser facility in MPW 3.2 and later. What about Tags, a really useful similar utility written by Rich Holzgrafe (Hi Rich!) if I don't remember wrong. I used it a lot, until we got 411 and On Location, but I think I should tag the CInclude files and start using it again. The Tags stuff is on any of the latest Developer CDs. While we are talking about useful developer tools, what about if the hacker community would start looking into these following possible projects: a) indentation program, C/C++ b) segmentation analyzis tool c) Something similar to UltraSlimFast, i.e. asm and high level code on the same page d) pretty printing of source code (style Pretty C, but just using Apple Events). e) modules with built-in C/C++ code check, for Alpha or similar environments Yes, I know, Apple should do all this, and in some cases we are looking into the issue. All I wanted to do was to raise the issue of collaborative hacking projects. If we bind similar tools together using Apple Events, we would sooner or later get a really nice set of development environment extensions that would work from either Think MPW or any other Apple Event aware development environment. Kent Sandvik/DTS =---= not in any way speaking for the company!!! - ------------------------- From: plogan@mentorg.com (Patrick Logan) Subject: Advanced MPW question Date: 31 Jan 92 16:32:25 GMT Organization: Mentor Graphics Corporation In article <65790006@col.hp.com> chrism@col.hp.com (Chris Magnuson) writes: What is the MPW equivalent to ctags? ctags and etags can be built from ...emacs/etc/etags.c in the GNU Emacs distribution. It is a simple program that could be ported and modified easily. Then you need an editor or tool that understands the ctags or etags formats. -- Patrick Logan, plogan@mentorg.com, Voice: (503) 685-7000 x2907, FAX: (503) 685-1282 Mentor Graphics Corp., Bldg. C, 8005 SW Boeckman Rd., Wilsonville, OR 97070 I can't gete the .signature virus and I can't gete the .signature - ------------------------- From: plogan@mentorg.com (Patrick Logan) Subject: Advanced MPW question Date: 3 Feb 92 22:26:35 GMT Organization: Mentor Graphics Corporation In article <65790006@col.hp.com> chrism@col.hp.com (Chris Magnuson) writes: What is the MPW equivalent to ctags? ctags and etags can be built from ...emacs/etc/etags.c in the GNU Emacs distribution. It is a simple program that could be ported and modified easily. Then you need an editor or tool that understands the ctags or etags formats. -- Patrick Logan, plogan@mentorg.com, Voice: (503) 685-7000 x2907, FAX: (503) 685-1282 Mentor Graphics Corp., Bldg. C, 8005 SW Boeckman Rd., Wilsonville, OR 97070 I can't gete the .signature virus and I can't gete the .signature - ------------------------- From: rmh@apple.com (Rick Holzgrafe) Subject: Advanced MPW question Date: 4 Feb 92 00:29:20 GMT Organization: Apple Computer, Inc. In article <65790006@col.hp.com>, chrism@col.hp.com (Chris Magnuson) writes: > > I develop alot in the UNIX environment. In UNIX there is this > binary called ctags that takes a bunch of source files and puts > all the function names in one file so that when you want to edit > a function you type: > > vi -t FunctionName > > And the vi editor opens up the correct file that contained the > function and you're right there, ready to edit! How nice. > > This is a very nice feature for multi-source programming projects. > > What is the MPW equivalent to ctags? > > chrism@col.hp.com Look on the Developer CD series for the "Tags for MPW" tool suite. It's very much what you're used to in Unix/vi, except that on the Mac you can specify the tag to look up by double-clicking it and selecting the "Find Tag" menu item (or typing the cmd-key equivalent). Also it handles name clashes by putting up a dialog listing each occurance of the name in the tags databases and letting you choose which one you want. The listing shows the name of the source file and the text of the source line for each occurance. The suite comes with the CTags, PTags, and ATags tools for tagging C and C++, Pascal, and Asm respectively; the FindTag tool which performs lookup; and the PopTag tool which lets you return easily from a nested series of Tags lookups. CTags in particular is very thorough, much more comprehensive than any other implementation I've seen (though I've been away from Unix for five years or so now). I'll briefly correct Keith Rollin: I'm principal but by no means sole author of these tools. Credit is given in the accompanying documents. On the Vol. VII Developer CD ("Lord of the Files") the tools may be found in the folder: Development Platforms (Moof!):MPW Related:Tags f where "f" is the script f or "integral sign" that I can't type on the net. On earlier or later CDs you're on your own, but the tools have been there in one form or another since Vol. III, I think. They're not on ftp.apple.com. These tools are free but unsupported. My cronies and I bang on them when we have spare time and inclination. You're welcome to send bug reports and enhancement requests but be prepared to be ignored, sorry. - --------------------------------------------------- Rick Holzgrafe rmh@apple.com AppleLink HOLZGRAFE1 {sun,voder,nsc,mtxinu,dual}!apple!rmh Apple Computer, Inc. 20525 Mariani Ave. MS: 3-PK Cupertino, CA 95014 --- My opinions, not Apple's. - ------------------------- From: ksand@apple.com (Kent Sandvik) Subject: Advanced MPW question Date: 31 Jan 92 04:50:02 GMT Organization: MacDTS Mongols In article <1992Jan30.151216.6369@waikato.ac.nz>, ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes: > In article <65790006@col.hp.com>, chrism@col.hp.com (Chris Magnuson) asks: > > What is the MPW equivalent to ctags? > There isn't one. The best you can do is try and get by using the CMarker > tool and the marker browser facility in MPW 3.2 and later. What about Tags, a really useful similar utility written by Rich Holzgrafe (Hi Rich!) if I don't remember wrong. I used it a lot, until we got 411 and On Location, but I think I should tag the CInclude files and start using it again. The Tags stuff is on any of the latest Developer CDs. While we are talking about useful developer tools, what about if the hacker community would start looking into these following possible projects: a) indentation program, C/C++ b) segmentation analyzis tool c) Something similar to UltraSlimFast, i.e. asm and high level code on the same page d) pretty printing of source code (style Pretty C, but just using Apple Events). e) modules with built-in C/C++ code check, for Alpha or similar environments Yes, I know, Apple should do all this, and in some cases we are looking into the issue. All I wanted to do was to raise the issue of collaborative hacking projects. If we bind similar tools together using Apple Events, we would sooner or later get a really nice set of development environment extensions that would work from either Think MPW or any other Apple Event aware development environment. Kent Sandvik/DTS =---= not in any way speaking for the company!!! - ------------------------- From: keith@Apple.COM (Keith Rollin) Subject: Advanced MPW question Date: 30 Jan 92 23:32:08 GMT Organization: Apple Computer Inc., Cupertino, CA In article <1992Jan30.151216.6369@waikato.ac.nz> ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes: >In article <65790006@col.hp.com>, chrism@col.hp.com (Chris Magnuson) asks: > >> What is the MPW equivalent to ctags? > >There isn't one. The best you can do is try and get by using the CMarker >tool and the marker browser facility in MPW 3.2 and later. There _is_ one; it just doesn't come with MPW. Rick Holzgrafe wrote PTags and CTags for MPW many years ago. Since he frequents this group, I'll let him fill you all in on features and availability. However, I'm pretty sure it's on the Developer CD from APDA. It might also be on ftp.apple.com. -- - ---------------------------------------------------------------------------- Keith Rollin --- <Taligent .signature under construction> Disclaimer: Pretty soon, I really _won't_ be speaking for Apple... --------------------------- From: michael@otago.ac.nz Subject: MacApp: IsObject isn't safe! Date: 29 Jan 92 02:11:50 GMT Organization: University of Otago, Dunedin, New Zealand I think I have just discovered that the MacApp global IsObject function isn't safe. I was using to test if a window I had added to the application free window list was still around. This however causes occasional address error crashes on 68000-based Macs as IsObject assumes it can go ahead and look for class and method IDs once IsHandle returns OK. This turns out not to be true sometimes in my case... A little more paranoia in IsObject would not go amiss - have ther been any patches to it? Michael(tm) Hamel, Computing Services Centre, University of Otago, New Zealand BALDOCK (n.) The sharp prong on the top of a tree stump where the tree has snapped off before being completely sawn through. - ------------------------- From: greggor@Apple.COM (Greg L. Anderson) Subject: MacApp: IsObject isn't safe! Date: 30 Jan 92 18:13:16 GMT Organization: Apple Computer Inc., Cupertino, CA In article <1992Jan29.151150.2071@otago.ac.nz> michael@otago.ac.nz writes: >I think I have just discovered that the MacApp global IsObject function isn't >safe. I was using to test if a window I had added to the application free >window list was still around. IsObject was not intended to be used in that capacity. The statement foo = (TFoo*)DisposeIfObject((Handle)foo); is only safe if foo is either a valid object or 'nil'. True, IsObject could do more tests & be more robust than it currently is, but code in the form bar = foo; foo = (TFoo*)DisposeIfObject((Handle)foo); // more allocations and stuff bar = (TFoo*)DisposeIfObject((Handle)bar); will never work, because it is always possible that the memory that foo formerly pointed to might be reused by some other object that would pass any test that IsObject might perform on it. The solution to your problem is to make sure that you remove your window from any list it happens to be on when you free it. -- ===================== =========================== ===================== Greg Anderson Apple Computer, Inc. O Ponnuki O Macintosh Bodhisattva Developer Tools Engineering O O is ideal O O greggor@apple.com Apple Developer Suite O shape O ===================== =========================== ===================== --------------------------- From: dxandy@cs.widener.edu (Andrew Greenshields) Subject: Saveing Linked Lists to a File Date: 19 Feb 1992 23:25:31 -0500 Organization: Widener University Department of Computer Science, Chester PA I have a data structure that consists of several identical objects connected using a linked list. I want to save this to a file, but I am worried that when I retrieve the information, the pointers I use to link one object to another may be invalid. Should I relink the list when I read it back into memory? Or does the OS have some fiendishly clever method of ensuring that the pointers remain valid? Thanks -- Andrew J. Greenshields N3IGS | "It looks like the top part fell on dxandy@cyber.widener.edu | the bottom part." - Dan Quayle dxandy@cs.widener.edu | ****** STANDARD DISCLAIMERS APPLY ****** =============================================================================== - ------------------------- From: russotto@eng.umd.edu (Matthew T. Russotto) Subject: Saveing Linked Lists to a File Date: Thu, 20 Feb 92 15:14:20 GMT Organization: University of Maryland, College Park, College of Engineering In article <kq6bdrINN2rt@ashley.cs.widener.edu> dxandy@cs.widener.edu (Andrew Greenshields) writes: > I have a data structure that consists of several identical objects >connected using a linked list. I want to save this to a file, but I >am worried that when I retrieve the information, the pointers I use to >link one object to another may be invalid. > > Should I relink the list when I read it back into memory? Or does >the OS have some fiendishly clever method of ensuring that the >pointers remain valid? You'll need to re-link the list. For the various resources the OS needs to keep linked in memory and on disk, it does do things-- i.e the MENU resource on disk has a 16-bit procid field referring to an MDEF, and a 16-bit filler after it. When loaded into memory, the procid is changed to a pointer to the MDEF. But if you save all these objects sequentially into a file, re-linking ought to be trivial. -- Matthew T. Russotto russotto@eng.umd.edu russotto@wam.umd.edu Your superior intellect is no match for our puny weapons! -- The Simpsons Just say NO to police searches and seizures. Make them use force. (not responsible for bodily harm resulting from following above advice) - ------------------------- From: Thad.Humphries@p950.f70.n109.z1.FidoNet.Org (Thad Humphries) Subject: Saveing Linked Lists to a File Date: 21 Feb 92 00:21:54 GMT AG> From: dxandy@cs.widener.edu (Andrew Greenshields) AG> Newsgroups: comp.sys.mac.programmer AG> Organization: Widener University Department of Computer Science, Chester AG> PA AG> AG> I have a data structure that consists of several identical objects AG> connected using a linked list. I want to save this to a file, but I AG> am worried that when I retrieve the information, the pointers I use to AG> link one object to another may be invalid. Why not just write out the text (or binary) of all but the pointers to a file. Read in the elements and use them as parameters to the call(s) that creates the data structure. You can then build new pointers as you go. (I'd send an example but the only one I have is in Lisp -- but it worked *beautifully*) * Origin: Quis custodiet ipsos custodes? (1:109/70.950) - ------------------------- From: lstein@athena.mit.edu (Lincoln Stein) Subject: Saveing Linked Lists to a File Date: 24 Feb 92 12:09:11 GMT Organization: Massachusetts Institute of Technology > I have a data structure that consists of several identical objects > connected using a linked list. I want to save this to a file, but I > am worried that when I retrieve the information, the pointers I use to > link one object to another may be invalid. You shouldn't write the pointers out to disk with the rest of the data. They are almost guaranteed to be invalid when you read them back in later. There are two approaches to this problem that I can think of right off and there should be many more: 1. If it is a singly-linked list (i.e. only one pointer per object), then you can traverse the list in a definite order, for example depth first. In that case, write the list out to disk in its natural order. You should either ignore the pointer part of the objects, or not write the pointers at all. Later, when you want to read the data structure back in, read the objects in one at a time, establishing new links and updating the pointers as you do so. 2. If the list is more complex and contains multiple interconnecting pointers, you can write the objects out to disk in any order you choose. As you do so, however, you must keep track of the position of the object within the file (i.e. the object's offset), locate all the pointers in the data structure which refer to this object, and convert them into offsets. You will need to create translate tables, etc. ======================================================================= Lincoln D. Stein Brigham & Women's Hospital lstein@hstbme.mit.edu Boston, MA ======================================================================= --------------------------- From: re00+@andrew.cmu.edu (Robert H Earhart) Subject: Extended PRAM Date: 20 Feb 92 17:03:36 GMT Organization: Freshman, MCS general, Carnegie Mellon, Pittsburgh, PA I assume that the lack of ideas on the subject means that NO ONE out there has any idea how to access extended PRAM... Unless you just missed the first post, and now you're getting set to write up a big long letter detailing exactly how it should be done which you'll post to the bboard... :) -Rob - ------------------------- From: russotto@eng.umd.edu (Matthew T. Russotto) Subject: Extended PRAM Date: Thu, 20 Feb 92 22:13:40 GMT Organization: University of Maryland, College Park, College of Engineering In article <4dcxxc_00WAvI=2b99@andrew.cmu.edu> re00+@andrew.cmu.edu (Robert H Earhart) writes: > > I assume that the lack of ideas on the subject means that NO ONE out >there has any idea how to access extended PRAM... > > Unless you just missed the first post, and now you're getting set to >write up a big long letter detailing exactly how it should be done >which you'll post to the bboard... :) It isn't hard at all. Two traps. _ReadXPram ($A051) A0: Pointer to storage area where PRAM value will be copied to. High word of D0: Number of bytes to be read Low word of D0: Where in PRAM to start reading. _WriteXPram ($A052) A0: Pointer to storage area where PRAM value will be copied from. High word of D0: Number of bytes to write. Low word of D0: Where in PRAM to start writing. -- Matthew T. Russotto russotto@eng.umd.edu russotto@wam.umd.edu Your superior intellect is no match for our puny weapons! -- The Simpsons Just say NO to police searches and seizures. Make them use force. (not responsible for bodily harm resulting from following above advice) - ------------------------- From: Earhart+@cmu.edu (Rob) Subject: Extended PRAM Date: 21 Feb 92 17:22:01 GMT Organization: Freshman, MCS general, Carnegie Mellon, Pittsburgh, PA Hmm... easy enough to make the calls... so does anyone know how many bytes there are in the PRAM, what they're used for, etc? -Rob - ------------------------- From: russotto@eng.umd.edu (Matthew T. Russotto) Subject: Extended PRAM Date: 24 Feb 92 15:52:36 GMT Organization: University of Maryland, College Park, College of Engineering In article <698692921.14649.0@acon.weh.andrew.cmu.edu> Earhart+@cmu.edu (Rob) writes: > > Hmm... easy enough to make the calls... so does anyone know how many bytes >there are in the PRAM, what they're used for, etc? Number of bytes varies with the machine. You can find out specific functions used if you are willing to MacsBug the ROM-- many of the traps which write PRAM are nothing more than a little parameter loading and a call to WriteXPram. Many of these calls are close together in ROM. As for the bytes which aren't there-- your guess is as good as mine. I believe the SE Mac II (IIx, IIcx, SE/30) machines have 256 bytes of PRAM, as do newer Plus's. The older machines have less, and I have no idea about the newer ones. -- Matthew T. Russotto russotto@eng.umd.edu russotto@wam.umd.edu Some news readers expect "Disclaimer:" here. Just say NO to police searches and seizures. Make them use force. (not responsible for bodily harm resulting from following above advice) --------------------------- From: marcf@sail.LABS.TEK.COM (Marc Frommer) Subject: Problem with ResEdit Date: 21 Feb 92 15:35:57 GMT Organization: Tektronix Inc., Beaverton, Or. A colleague of mine has been having a problem using ResEdit and popup controls. His description of the problem follows. Has anyone out there encountered the same problem and is there a simple workaround for it? Problems occur when System 7 popup menu controls (popupMenuProc) are incorporated into DITL resources using ResEdit (version 2.1.1 and earlier). The controls use ResEdit menus, cause ResEdit to crash, and trash the resource file being edited (e.g. substitute ResEdit menu items in place of those in the resource file). This greatly hampers the use of these controls, because ResEdit provides the easiest way of adding, modifying, and deleting them, showing their layout with respect to other dialog items, and incorporating them into the item list so that dialog handling code can refer to them by item number (e.g. itemHit returned by ModalDialog or DialogSelect) rather than having to store and compare against ControlHandle values returned by NewControl or GetNewControl. Thanks. marc -- Marc Frommer marcf@sail.LABS.TEK.COM CAChe Scientific, Inc. 627-1200 - ------------------------- From: jxs18@po.CWRU.Edu (Jerry Sy) Subject: Problem with ResEdit (Attention Apple!) Date: 21 Feb 92 19:48:04 GMT Organization: Case Western Reserve University, Cleveland, OH (USA) In a previous article, marcf@sail.LABS.TEK.COM (Marc Frommer) says: > >A colleague of mine has been having a problem using ResEdit and popup >controls. His description of the problem follows. Has anyone out >there encountered the same problem and is there a simple workaround for >it? > >Problems occur when System 7 popup menu controls (popupMenuProc) are >incorporated into DITL resources using ResEdit (version 2.1.1 and earlier). >The controls use ResEdit menus, cause ResEdit to crash, and trash the >resource file being edited (e.g. substitute ResEdit menu items in place >of those in the resource file). This greatly hampers the use of these >controls, because ResEdit provides the easiest way of adding, modifying, >and deleting them, showing their layout with respect to other dialog items, >and incorporating them into the item list so that dialog handling code can >refer to them by item number (e.g. itemHit returned by ModalDialog >or DialogSelect) rather than having to store and compare against >ControlHandle values returned by NewControl or GetNewControl. > >Thanks. >marc Marc, I have indeed encountered this problem as early as Sys 7 came out and Resedit 2.1. The problem is with the dialog editor of resedit, when you create your popup controls at first, it is ok, but once you play around with it in the dialog editor (e.g. click on that Item), it messes up the resource header for the menu recource attached to it. Particularly, it puts garbage into the first 4 words of the menu resource header, but the one that causes the crashing is the procid field of the menu resource. Create your ditl and dlog with the popup control and menu resources, try not to play around with the popup yet, close it as soon as you are done. This way, sometimes Resedit messes up the menu, sometimes it doesn't. so my solution is to open up that menu resource (the one related to the popup control) using the template editor, and set the procid field to 0. Better yet, open it up using the hex editor and set the 2nd 3rd and 4th WORD in the resource to 0. Apple has denied this problem again and again, even though I have told them that I have seen like about 6 postings already of people having this problem and after doing my fix, it worked right away! Now you are the 7th person whom I have seen who have this exact same problem. I had a reply once though from one of the developers of Resedit and he said that getting this bug fixed will be next to impossible since Apple only hired temporary programmers to do the ResEdit 2.1 project and all has been long gone! Another reply I got was from Resourcerer, but they were just trying to sell me their product. I figured this problem out by single stepping through Resedit using macsbug. Email me if you are still having problems, I'll be glad to help. jerry sy - ------------------------- From: paulr@syma.sussex.ac.uk (Paul Russell) Subject: Problem with ResEdit Date: 24 Feb 92 10:53:29 GMT Organization: University of Sussex >From article <11423@sail.LABS.TEK.COM>, by marcf@sail.LABS.TEK.COM (Marc Frommer): > > A colleague of mine has been having a problem using ResEdit and popup > controls. His description of the problem follows. Has anyone out > there encountered the same problem and is there a simple workaround for > it? > > Problems occur when System 7 popup menu controls (popupMenuProc) are > incorporated into DITL resources using ResEdit (version 2.1.1 and earlier). > The controls use ResEdit menus, cause ResEdit to crash, and trash the > resource file being edited (e.g. substitute ResEdit menu items in place > of those in the resource file). This greatly hampers the use of these > controls Yes, we've been seeing the same thing recently. A colleague had a problem where the procID of the popup menus was being randomly changed by ResEdit from 0 (standard text menu) to 7 or 8. Also, weird things happen when you try to display the popup menus in the DITL editor (ResEdit's own menus appearing etc). We checked all the obvious things - turn off extensions etc. Looks like a real live bug... //Paul -- | Paul Russell | "Microsoft MS-DOS 5.0 gives your | | Dept Experimental Psychology | computer something you'll both | | University of Sussex, Falmer | love - an extra 45k memory." | | Brighton BN1 9QG, England | -- Microsoft advertisement | --------------------------- From: al161926@mtecv2.mty.itesm.mx (Jesus Barrera Ramos) Subject: Where can I find Teach-YourSelf-like manuals for THINK C? Date: 22 Feb 92 16:15:29 GMT Organization: I.T.E.S.M. Campus Monterrey Hi everybody: See...I have a little trouble here at school 'cause here there'r no good manuals to use Think C ...I've looked for some at book stores but haven't got luck...I'd thank you any suggestion ....mmmmhhhh...Where can I find any book like that?!?!...it's quite hard to find bibliography here...Thanks in advance. Jesus Barrera Ramos (Eqix) al161926@mtecv2.mty.itesm.mx bl161926@tecmtyvm.mty.itesm.mx al163413@next00.mty.itesm.mx P.S. As you'd c...I'm a novice usin' mac. 8) - ------------------------- From: bj646@cleveland.Freenet.Edu (Thomas James Vilot) Subject: Where can I find Teach-YourSelf-like manuals for THINK C? Organization: Case Western Reserve University, Cleveland, OH (USA) Date: Mon, 24 Feb 92 03:26:19 GMT In a previous article, al161926@mtecv2.mty.itesm.mx (Jesus Barrera Ramos) says: >Hi everybody: > >See...I have a little trouble here at school 'cause here there'r no >good manuals to use Think C ...I've looked for some at book stores but >haven't got luck...I'd thank you any suggestion ....mmmmhhhh...Where can >I find any book like that?!?!...it's quite hard to find bibliography >here...Thanks in advance. > > > Jesus Barrera Ramos > (Eqix) > al161926@mtecv2.mty.itesm.mx > bl161926@tecmtyvm.mty.itesm.mx > al163413@next00.mty.itesm.mx > >P.S. As you'd c...I'm a novice usin' mac. 8) > For the novice Macontosh Toolbox programmer, I don't think you can go wrong with the macintosh programming primer by Dave Mark and Carright Reed (Adison Wesley Publishing ISBN: 0-201-15662-8) There are two volumes out on this series. It should give you a pretty good overview. Then there is "Using the Macintosh Toolbox with C" by Fred A. Huxham, David Burnard and Jim Takatsuka (SYBEX Books, ISBN: 0-89588-572-7). This book goes into much more detail about many more routines than does the former. Good Luck! v v and Carwright Reed (Adison Wesley Publsihing,ISBN-0-201-15 -- Thomas J. Vilot "Blessings of the masses, vilot@bigboy.cis.temple.edu "Blessings of the State... Jeffersonville, PA "Buy. Buy more. Buy now..." -THX1138 --------------------------- From: speth@cats.ucsc.edu (James Gustave) Subject: Beginner needs HELP! Date: 22 Feb 92 20:49:28 GMT Organization: University of California, Santa Cruz I've just started to program on the Mac, and I've got one big question. I'm familiar with the use of header files, object files and makefiles on unix systems. How do you do similar things in Think C? Up till now, I've just been putting all the code in one file. But I know there is a way to do this. And being trained for years not to open a manual, I decided to ask here. Thanks, -Jim - ------------------------- From: bj646@cleveland.Freenet.Edu (Thomas James Vilot) Subject: Beginner needs HELP! Organization: Case Western Reserve University, Cleveland, OH (USA) Date: Mon, 24 Feb 92 03:18:37 GMT In a previous article, speth@cats.ucsc.edu (James Gustave) says: > > I've just started to program on the Mac, and I've got one big question. >I'm familiar with the use of header files, object files and makefiles on >unix systems. How do you do similar things in Think C? > Up till now, I've just been putting all the code in one file. But I >know there is a way to do this. And being trained for years not to >open a manual, I decided to ask here. > Thanks, > -Jim > > This is funny. You would probably be happier and more at home in MPW (a bear of an environment, but more UNIX-like than THINK C is for you). for the most part, you will find with THINK that you DON'T need to think about make files and object files AT ALL. As far as breaking that file up goes, you just nead to include the new header files for each separate code file into the code files that need to know about them. That is, (as I think you already know, but please be patient!) your "main" might need to #include "main.h" which might need to know about your "prefsDialog.h" for example. Are you mostly interested in OOP, or are you working in conventional C? OOP gets a little more funky, since objects need to know about the prototypes of methods of other objects and they have to be properly inherited so your inherited methods will work. Is any of this helpful? I feel terribly vague tonight.! Regards! -- Thomas J. Vilot "Blessings of the masses, vilot@bigboy.cis.temple.edu "Blessings of the State... Jeffersonville, PA "Buy. Buy more. Buy now..." -THX1138 - ------------------------- From: suitti@ima.isc.com (Stephen Uitti) Subject: Beginner needs HELP! Date: 24 Feb 92 17:10:32 GMT Organization: Interactive Systems, Cambridge, MA 02138-5302 In article <29215@darkstar.ucsc.edu> speth@cats.ucsc.edu (James Gustave) writes: > I've just started to program on the Mac, and I've got one big question. >I'm familiar with the use of header files, object files and makefiles on >unix systems. How do you do similar things in Think C? > Up till now, I've just been putting all the code in one file. But I >know there is a way to do this. And being trained for years not to >open a manual, I decided to ask here. > Thanks, > -Jim RTFM. Actually, the manuals are very good, and you don't have to read every word. For example, header files. The index to Version 5.0 has: header files aliases, and finding once-only opening precompiling prototypes, and toolbox The page numbers cover about six sections of a few pages each, all of which are relevant and to the point. If you had looked up #include, it points to the above "header files" entry. #includes work pretty much as they do in a UNIX environment. However, the search path structure (finding), and the precompiling are Mac specific. Further, the user interface (opening) is handy. Another example, libraries: libraries 273-276 ... creating 274-275 ... You probably only need to read two pages to figure it all out. They aren't that hard. There are several options. I just use projects for libraries, myself. The real point is that if you have used C under UNIX, you know enough keywords to use the index effectively. If you just want a C environment that is UNIX-like (a dumb terminal), check out the console. Remember to #include <console.h>. If you want to write Macintosh programs, check out TCL. One other note. Someone else suggested that you'd like MPW. As a seasoned UNIX programmer (10 years), I don't find MPW to be very UNIX-like. In UNIX, tools you build run under UNIX. Under MPW, tools you build run under MPW, which is not at all Mac-like. The compilers are slow, the linker especially. The debuggers are awkward. The system requires a huge amount of disk and RAM to run properly. The manuals are poorly organized. The whole result feels like a cross compiler. It's like using a DOS compilation and debugging environment for an Apollo project. You'd do it if you had to, but why not use the Apollo's native compilers? After all, they produce better code. Stephen suitti@ima.isc.com --------------------------- From: umnoor@ccu.umanitoba.ca (Nasir Ahmed Noor) Subject: Could you please help me with this....? Date: 23 Feb 92 00:57:29 GMT Organization: University of Manitoba, Winnipeg, Canada i have recently started programming in Mac "interface" style. i am still lost about a lot of things. could some one mail me (or post) a couple of sample programs which could help me with the concept of using different routines for files/windows/dialogs. you see all these routines are given in inside mac but how to make all these work together is still not clear. i will really appreciate some sample programs or directions for an ftp site where such model programs are held. thanks a lot. nasir ahmed noor umnoor@ccu.umanitoba.ca - ------------------------- From: bj646@cleveland.Freenet.Edu (Thomas James Vilot) Subject: Could you please help me with this....? Date: 24 Feb 92 03:12:20 GMT Organization: Case Western Reserve University, Cleveland, OH (USA) In a previous article, umnoor@ccu.umanitoba.ca (Nasir Ahmed Noor) says: > >i have recently started programming in Mac "interface" style. i am still lost >about a lot of things. could some one mail me (or post) a couple of sample >programs which could help me with the concept of using different routines >for files/windows/dialogs. you see all these routines are given in inside mac >but how to make all these work together is still not clear. > >i will really appreciate some sample programs or directions for an ftp site >where such model programs are held. > >nasir ahmed noor >umnoor@ccu.umanitoba.ca > It sounds to me like the best thing for you to do is get your hands on a copy of the Macintosh Programming Primer, Vols I & II. These are good into books for programming the Mac interface and they are especially good if you are using THINK C, since they focus most of their instructions around that development environment. To ask for sample programs I think might get unwieldy. Programming the mac requires that nasty event loop, so there are a lot of "trees" to follow down to the levels where you bring up dialogs and such. But, I will email you whatever I can piece together, here. It might help if you explained a little more what you already understand. Best of luck (it's a bastard of a machine to program!) -- Thomas J. Vilot "Blessings of the masses, vilot@bigboy.cis.temple.edu "Blessings of the State... Jeffersonville, PA "Buy. Buy more. Buy now..." -THX1138 - ------------------------- From: jxs18@po.CWRU.Edu (Jerry Sy) Subject: Could you please help me with this....? Date: 24 Feb 92 14:31:36 GMT Organization: Case Western Reserve University, Cleveland, OH (USA) In a previous article, bj646@cleveland.Freenet.Edu (Thomas James Vilot) says: > >In a previous article, umnoor@ccu.umanitoba.ca (Nasir Ahmed Noor) says: > >> >>i have recently started programming in Mac "interface" style. i am still lost >>about a lot of things. could some one mail me (or post) a couple of sample >>programs which could help me with the concept of using different routines >>for files/windows/dialogs. you see all these routines are given in inside mac >>but how to make all these work together is still not clear. >> >>i will really appreciate some sample programs or directions for an ftp site >>where such model programs are held. >> >>nasir ahmed noor >>umnoor@ccu.umanitoba.ca >> The way Inside Mac is organized is not that great to start with, so don't worry if you cannot understand the documentation at first, once you get the hang of it, then it will be easy! I know Apple is reorganizing all the Inside Mac Volumes and have a partially complete version in their Developer CD's for the last three months or so. I wonder if they are going to publish their New and Improved Inside Macintosh in printed form ? --------------------------- End of C.S.M.P. Digest **********************